package com.sleep.model;

import javax.persistence.*;

/**
 * Created by fadinglan on 2017/4/10.
 */
@Entity
@Table(name = "device_info", schema = "teenagers_monitor", catalog = "")
public class DeviceInfoEntity {
    private int iId;
    private String vcDeviceId;
    private String vcDeviceName;

    @Id
    @Column(name = "i_id", nullable = false)
    public int getiId() {
        return iId;
    }

    public void setiId(int iId) {
        this.iId = iId;
    }

    @Basic
    @Column(name = "vc_device_id", nullable = false, length = 20)
    public String getVcDeviceId() {
        return vcDeviceId;
    }

    public void setVcDeviceId(String vcDeviceId) {
        this.vcDeviceId = vcDeviceId;
    }

    @Basic
    @Column(name = "vc_device_name", nullable = true, length = 20)
    public String getVcDeviceName() {
        return vcDeviceName;
    }

    public void setVcDeviceName(String vcDeviceName) {
        this.vcDeviceName = vcDeviceName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        DeviceInfoEntity that = (DeviceInfoEntity) o;

        if (iId != that.iId) return false;
        if (vcDeviceId != null ? !vcDeviceId.equals(that.vcDeviceId) : that.vcDeviceId != null) return false;
        if (vcDeviceName != null ? !vcDeviceName.equals(that.vcDeviceName) : that.vcDeviceName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = iId;
        result = 31 * result + (vcDeviceId != null ? vcDeviceId.hashCode() : 0);
        result = 31 * result + (vcDeviceName != null ? vcDeviceName.hashCode() : 0);
        return result;
    }
}
